cmake_minimum_required( VERSION 3.16.0 )

project( membandwidth LANGUAGES CXX )
set( CMAKE_CXX_STANDARD 20 )

include( CheckCXXCompilerFlag )
check_cxx_compiler_flag( -Wall HAVE_WALL )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )

set( CMAKE_POSITION_INDEPENDENT_CODE ON )
set( THREADS_PREFER_PTHREAD_FLAG ON )
find_package( Threads REQUIRED )

add_executable( mem-bw bandwidth.cpp mini-log.cpp )
target_link_libraries( mem-bw Threads::Threads numa )

install( TARGETS mem-bw RUNTIME DESTINATION "." )
